﻿<%@ Page Language="C#" MasterPageFile="~/Common/Master/FrameMain.master" AutoEventWireup="true"
    Inherits="Admin_User_List" Title="无标题页" Theme="SkinFile" CodeBehind="List.aspx.cs" %>

<%@ Register Src="../../Common/Controls/Footer.ascx" TagName="Footer" TagPrefix="uc1" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server">

    <script type="text/javascript">
        function moveDept()
        {
            var hidSelectIDs = document.getElementById('<%=hidSelectIDs.ClientID %>');
            var btnRefresh = document.getElementById('<%=btnRefresh.ClientID %>');
            var url = "Move.aspx?UserIDs=" + hidSelectIDs.value;

            var rtValue = showDlg(url);
            if (rtValue == true)
            {
                btnRefresh.click();
            }
        }
    </script>

</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
    <asp:HiddenField ID="hidOrders" runat="server" />
    <div id="toolbar">
        <ul>
            <li><a id="lnkAdd" runat="server" href="javascript:go()"><span><b style="background-image: url(../../common/images/icons/addnew.gif);">
                &nbsp;</b><asp:Literal ID="Literal1" runat="server" Text="增加"></asp:Literal></span></a></li>
            <li><a id="lnkStartup" runat="server" href="javascript:go()"><span><b style="background-image: url(../../common/images/icons/startup.gif);">
                &nbsp;</b><asp:Literal ID="Literal2" runat="server" Text="启用"></asp:Literal></span></a></li>
            <li><a id="lnkStop" runat="server" href="javascript:go()"><span><b style="background-image: url(../../common/images/icons/stop.gif);">
                &nbsp;</b><asp:Literal ID="Literal3" runat="server" Text="停用"></asp:Literal></span></a></li>
            <li><a id="lnkDelete" runat="server" href="javascript:go()"><span><b style="background-image: url(../../common/images/icons/DelUser.gif);">
                &nbsp;</b><asp:Literal ID="Literal4" runat="server" Text="删除"></asp:Literal></span></a></li>
            <li><a id="lnkMove" runat="server" href="javascript:go()"><span><b style="background-image: url(../../common/images/icons/move.gif);">
                &nbsp;</b>移动</span> </a></li>
            <li><a id="lnkSaveOrders" runat="server" href="javascript:go()"><span><b style="background-image: url(../../common/images/icons/SORT.gif);">
                &nbsp;</b><asp:Literal ID="Literal5" runat="server" Text="排序"></asp:Literal></span></a></li>
        </ul>
    </div>
    <%--<asp:UpdatePanel ID="UpdatePanel1" runat="server">
        <ContentTemplate>
        </ContentTemplate>
        <Triggers>
            <asp:AsyncPostBackTrigger ControlID="btnRefresh" />
            <asp:AsyncPostBackTrigger ControlID="btnDelete" />
            <asp:AsyncPostBackTrigger ControlID="btnStartup" />
            <asp:AsyncPostBackTrigger ControlID="btnStop" />
            <asp:AsyncPostBackTrigger ControlID="btnSaveOrders" />
        </Triggers>
    </asp:UpdatePanel>--%>
    <div id="head">
        <div class="left">
            <asp:Label ID="lblDeptName" runat="server" Text="Label" Visible="false" Font-Bold="true"></asp:Label><asp:Label
                ID="lblStatistic" runat="server" Text="Label"></asp:Label></div>
        <div class="right">
            <asp:Label ID="Label4" runat="server" Text="用户名：" Font-Bold="true"></asp:Label><asp:TextBox
                ID="txtSearch" runat="server" Width="113px" CssClass="txt"></asp:TextBox>
                
            <asp:Button ID="btnSearch" runat="server" Text="搜索" 
                onclick="btnRefresh_Click" />
            <asp:DropDownList ID="drpPager" runat="server" OnSelectedIndexChanged="drpPager_SelectedIndexChanged">
            </asp:DropDownList>
        </div>
    </div>
    <div id="list">
        <asp:HiddenField ID="hidSelectIDs" runat="server" Value="" />
        <table id="lvList" cellpadding="0" cellspacing="0" border="0" width="100%">
            <tr id="lvHeader" runat="server">
                <th class="sp">
                    &nbsp;
                </th>
                <th class="chk">
                    <asp:CheckBox ID="chkSelectAll" runat="server" />
                </th>
                <th>
                    用户姓名
                </th>
                <th>
                    登录名
                </th>
                <th>
                    部门
                </th>
                <th>
                    <asp:LinkButton ID="btnStatus" runat="server" CommandArgument="Status">状态</asp:LinkButton>
                </th>
                <th>
                    角色
                </th>
                <th>
                    模块
                </th>
                <th>
                    权限
                </th>
                <th>
                    排序
                </th>                
            </tr>
            <asp:ListView ID="lv" runat="server" ItemPlaceholderID="items" 
                onitemdatabound="lv_ItemDataBound">
                <LayoutTemplate>
                    <tr id="items" runat="server">
                    </tr>
                </LayoutTemplate>
                <ItemTemplate>
                    <tr id="row" runat="server">
                        <td class="sp">
                            &nbsp;
                        </td>
                        <td class="chk">
                            <asp:CheckBox ID="chkSelect" runat="server" />
                        </td>
                        <td>
                            <asp:HyperLink ID="lnkName" runat="server" NavigateUrl="#" Text='<%# Eval("Name") %>'
                            EnableViewState="False"></asp:HyperLink>
                        </td>
                        <td>
                            <%#Eval("LoginName") %>&nbsp;
                        </td>
                        <td>
                            <%# Eval("DeptName")%>&nbsp;
                        </td>
                        <td>
                            <%# (Jzy.Core.Admin.UserStatus)Eval("Status") %>
                        </td>
                        <td>
                            <asp:Image ID="imgRole" runat="server" ImageUrl="~/common/images/Common/USERS.GIF" />
                        </td>
                        <td>
                            <asp:Image ID="imgModule" runat="server" ImageUrl="~/common/images/Common/roleFunction.gif"
                            ToolTip="选择模块" EnableViewState="False" />
                        </td>
                        <td>
                            <asp:Image ID="imgRight" runat="server" ImageUrl="~/common/images/Common/right.gif" />
                        </td>
                        <td>
                            <asp:TextBox ID="txtOrders" runat="server" Text='<%# Eval("Orders") %>' Width="30px"
                            EnableViewState="False" CssClass="out"></asp:TextBox>
                        <asp:RegularExpressionValidator ID="RegularExpressionValidator2" runat="server" ControlToValidate="txtOrders"
                            Display="Dynamic" ErrorMessage="数字格式不对" ValidationExpression="-?\d*"></asp:RegularExpressionValidator>
                        </td>
                       
                    </tr>
                </ItemTemplate>
                <EmptyDataTemplate>
                    <tr>
                        <td colspan="10" class="empty">
                            没有用户
                        </td>
                    </tr>
                </EmptyDataTemplate>
            </asp:ListView>
        </table>       
    </div>
    <uc1:Footer ID="Footer1" runat="server" />
    <div id="toolbar_bottom">
        <asp:Button ID="btnStartup" runat="server" OnClick="btnStartup_Click" Text="启用" />
        <asp:Button ID="btnStop" runat="server" OnClick="btnStop_Click" Text="停用" />
        <asp:Button ID="btnRefresh" runat="server" Text="Button" OnClick="btnRefresh_Click"
            CssClass="refresh" />
        <asp:Button ID="btnDelete" runat="server" Text="删除" OnClick="btnDelete_Click" CausesValidation="False" />
        <input id="btnMove" runat="server" type="button" value="移动" />
        <asp:Button ID="btnSaveOrders" runat="server" Text="排序" OnClick="btnSaveSequence_Click"
            CausesValidation="False" />
    </div>
</asp:Content>
